-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement array patterns #1912
Merged
Merged
Implement array patterns #1912
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yannham
force-pushed
the
feat/array-patterns
branch
from
May 13, 2024 13:31
b4e75fe
to
a7eacc3
Compare
yannham
commented
May 13, 2024
/// | ||
/// The type of each "leaf" identifier will be assigned based on the `mode` argument. The current | ||
/// possibilities are for each leaf to have type `Dyn`, to use an explicit type annotation, or to | ||
/// be assigned a fresh unification variable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was somehow redundant with the documentation of the trait itself, and had not much to do here, attached to a specific implementation.
yannham
force-pushed
the
feat/array-patterns
branch
from
May 13, 2024 13:41
a7eacc3
to
f3b3632
Compare
🎉 All dependencies have been resolved ! |
Merged
This commit adds a new calss of patterns: array patterns. This is a natural extension, both syntactically and semantically, of existing data structure patterns in Nickel (in particular of records). Similarly, arrays pattern can also capture the rest of the pattern (the tail of the array that hasn't been matched yet) and bind it to a variable.
yannham
force-pushed
the
feat/array-patterns
branch
from
May 13, 2024 16:34
f3b3632
to
0ab9793
Compare
jneem
approved these changes
May 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on #1910.
This commit adds a new class of patterns: array patterns. This is a natural extension, both syntactically and semantically, of existing data structure patterns in Nickel (in particular of records). Similarly, arrays pattern can also capture the rest of the pattern (the tail of the array that hasn't been matched yet) and bind it to a variable.